package com.stage.proxy;

import com.stage.annotation.IPerson;
import com.stage.annotation.Person;

import java.lang.reflect.Proxy;

/**
 * Created by Stage on 2017/3/10.
 */
public class DynamicPersonProxyMain {
    public static void main(String[] args) {
        Person person = new Person();
        IPerson personSet = (IPerson) Proxy.newProxyInstance(IPerson.class.getClassLoader(), new Class[]{IPerson.class}, new DynamicPersonProxy((person)));
        personSet.setIdNo("1522222222");
    }
}
